//
//  CommonTableViewCell.m
//  LOLProject
//
//  Created by lanou3g on 15/5/30.
//  Copyright (c) 2015年 lanou3g.com蓝欧科技. All rights reserved.
//

#import "CommonTableViewCell.h"

@implementation CommonTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void) showTheLatestVideoListOnCommonTableViewCell{
    [self.CommonImageView sd_setImageWithURL:[NSURL URLWithString:self.theLatestVideoList.thumbnail] placeholderImage:[UIImage imageNamed:kPlaceholderImage]];
    self.CommonTitle.text=self.theLatestVideoList.title;
    self.CommonPublished.text=[NSString stringWithFormat:@"发布:%@",[self.theLatestVideoList.published substringToIndex:10]];
    float time=[self.theLatestVideoList.duration floatValue];
    self.CommonDuration.text=[NSString stringWithFormat:@"时长:%d:%02d",(int)(time/60),(int)(time-((int)(time/60))*60)];
    return;
}

- (void) showHdBroadcastListOnCommonTableViewCell{
    [self.CommonImageView sd_setImageWithURL:[NSURL URLWithString:self.hdBroadcastList.room_src] placeholderImage:[UIImage imageNamed:kPlaceholderImage]];
    self.CommonTitle.text=self.hdBroadcastList.room_name;
    self.CommonPublished.text=[NSString stringWithFormat:@"主播:%@",self.hdBroadcastList.nickname];
    self.CommonDuration.text=[NSString stringWithFormat:@"%@人观看",self.hdBroadcastList.online];
    return ;
}

- (void) showCommentaryDetailOnCommonTableViewCell{
    [self.CommonImageView sd_setImageWithURL:[NSURL URLWithString:self.commentaryDetail.img] placeholderImage:[UIImage imageNamed:kPlaceholderImage]];
    self.CommonTitle.text=self.commentaryDetail.title;
    self.CommonPublished.text=[NSString stringWithFormat:@"作者:%@",self.commentaryDetail.username];
    self.CommonDuration.text=[NSString stringWithFormat:@"发布时间:%@",[self.commentaryDetail.pubdate substringToIndex:10]];
    return;
    return ;
}

@end
